<template>
  <div class="page-container">
    <div v-if="showHeader" class="page-header">
      <h1 class="page-title">{{ title }}</h1>
      <div class="page-actions">
        <slot name="actions"></slot>
      </div>
    </div>
    <div class="page-content">
      <slot></slot>
    </div>
  </div>
</template>

<script setup lang="ts">
interface Props {
  title?: string
  showHeader?: boolean
}

withDefaults(defineProps<Props>(), {
  title: '',
  showHeader: true
})
</script>

<style lang="scss" scoped>
.page-container {
  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

    .page-title {
      font-size: 18px;
      font-weight: 500;
      color: #303133;
      margin: 0;
    }

    .page-actions {
      display: flex;
      gap: 12px;
    }
  }

  .page-content {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }
}
</style>